from elasticsearch import Elasticsearch
es =Elasticsearch(['219.224.134.226:9099'])

with open('nicknames.txt','r',encoding='utf-8') as fp:
    unames = [line.strip() for line in fp]
with open('yinyu_uids.txt','r',encoding='utf-8') as fp:
    uids = [line.strip() for line in fp]

query ={"query":{
    "terms":{
        "_id":uids
    }
},
"size":1000
}
r = es.search(index='weibo_yinyu',doc_type='user',body=query,_source=['screen_name'],)['hits']['hits']
# print(r)
new_l = []
for i in r:
    new_l.append(i['_source']['screen_name'])
for i in unames:
    if i not in new_l:
        print(i)
